package net.qhzw.vip.qiyu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.qhzw.vip.qiyu.entity.DtsCarRetreat;
import net.qhzw.vip.qiyu.model.DtsCarRetreatVo;
import net.qhzw.vip.qiyu.model.RetreatDetailed;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface DtsCarRetreatMapper extends BaseMapper<DtsCarRetreat> {


    /***
     * 退车费用分页列表查询
     */
    List<DtsCarRetreatVo> findByPage(@Param("idCard") String idCard,
                                     @Param("mobile") String mobile,
                                     @Param("realName") String realName,
                                     @Param("siteId") Long siteId,
                                     @Param("communityId") Long communityId,
                                     @Param("shopId") Long shopId);

    /***
     * 查询今日退车量
     * @param shopId
     * @return
     */
    Map<String, Integer> returnAmount(@Param("shopId") Long shopId);


    /***
     * 退车明细
     * @return
     */
    List<RetreatDetailed> findRetreatDetailed(@Param("idCard") String idCard,
                                              @Param("mobile") String mobile,
                                              @Param("realName") String realName,
                                              @Param("siteId") Long siteId,
                                              @Param("communityId") Long communityId,
                                              @Param("shopId") Long shopId);

    /***
     * 导出退车欠款未结清记录
     * @return
     */
    List<RetreatDetailed> findRetreatDetailed2(@Param("communityId") Long communityId,
                                               @Param("shopId") Long shopId);

    /**
     * 查询退车时配件费用
     * @param id
     * @return
     */
    Double findMaintCost(Long id);

    String getCarRetreatTransactionId(String orderNumber);


    String getRetreatTransactionId(Long id);
}